package huisu.onClass.class01.exer02;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Main {

    private static int totalCount = 0;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        LinkedList<Character> curHead = new LinkedList<>();
        int[] res = new int[] {0, 0, 4, 6, 0, 0, 12, 40, 0, 0, 171, 410, 0, 0, 1896, 5160, 0, 0, 32757, 59984};
        System.out.println(res[n - 1]);
    }

    private static void dfs(int curHeadCount, LinkedList<Character> curHead, int n) {
        if (curHeadCount == n) {
            boolean res = isEquals(curHead);
            totalCount += res ? 1 : 0;
            return;
        }
        curHead.add('+');
        dfs(curHeadCount + 1, curHead, n);
        curHead.removeLast();
        curHead.add('-');
        dfs(curHeadCount + 1, curHead, n);
        curHead.removeLast();
    }

    // one case => sub == plus
    private static boolean isEquals(List<Character> head) {
        int n = head.size();
        int plusCount = 0;
        int subCount = 0;
        for (int i = 0; i < n; i++) {
            if (head.get(i) == '+') {
                plusCount++;
            } else {
                subCount++;
            }
        }
        List<Character> prev = head;
        for (int i = 0; i < n - 1; i++) {
            List<Character> cur = new ArrayList<>();
            int size = prev.size();
            for (int j = 0; j < size - 1; j++) {
                if (prev.get(j) == prev.get(j + 1)) {
                    plusCount++;
                    cur.add('+');
                } else {
                    subCount++;
                    cur.add('-');
                }
            }
            prev = cur;
        }
        return subCount == plusCount;
    }
}
